﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class SoundRecord : Button {


    static bool isStart = false;
	// Update is called once per frame
	void Update () {
		
	}

    public override void OnPointerDown(PointerEventData eventData)
    {   if (!isStart)
        {
            isStart = true;
            SoundManager.Instance.StarRecord();
        }
        SoundManager.Instance.IsRecording = true;
        base.OnPointerDown(eventData);
    }

    public override void OnPointerUp(PointerEventData eventData)
    {
        SoundManager.Instance.IsRecording = false;
        base.OnPointerUp(eventData);
        SoundManager.Instance.RecordEnd();
        isStart = false;
    }

}
